Skip to content

fix(id): bind export blob verification to envelope content citations - #13376

Closed
dezren39 wants to merge 1 commit into
mainfrom
lane-xb-13289
Closed

dezren39 wants to merge 1 commit into
mainfrom
lane-xb-13289

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

For #13289 — the hosted export/import verification gap.

Problem

verify_import built referenced_blobs only from each object's caller-supplied blob_refs and checked those names against the carried blob hashes. blob_refs is covered by neither the manifest's objects_digest nor the object's envelope signature, so a valid signed document.put envelope citing content A could be paired with unrelated bytes B (named by blob_refs), pass verification, and be reported as a complete import while the cited content A stayed unavailable.

Change (pkgs/id/src/hosted_export.rs only)

  • verify_import now derives each object's content citations from its verified envelope (the decode already performed for the signature check; citations_of factored out of cited_content_hashes so both share one definition), indexes carried blobs by the BLAKE3 citation their bytes resolve, and binds the two: every signed citation must resolve by content to a carried blob (MissingBlob when it cannot), and the object's blob_refs must name exactly the resolved blobs — otherwise the new typed refusal ExportError::CitationBlobMismatch.
  • Regression tests: the decoy pairing from the issue, a missing cited blob, and an extra reference naming an uncited carried blob.

Verification (laptop route; the fleet-build container lacks the pkgs/id nix toolchain shell)


Run Proof
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…13289)

verify_import trusted each object's unsigned blob_refs: the
reference list only had to be consistent with the carried blob
set, so a valid signed document.put citing content A could be
paired with decoy bytes B and pass verification, leaving the
cited content absent after a "complete" import.

Verification now derives each object's content citations from
its verified envelope, resolves them by content (BLAKE3 ->
SHA-256 blob name) against the carried blobs, and requires the
object's references to name exactly the resolved blobs. A cited
blob the export does not carry is MissingBlob; references that
name anything else are the new CitationBlobMismatch refusal.

Regression tests cover the decoy pairing, a missing cited blob,
and an extra reference; the honest round-trip and the
cross-language produced-sets fixture still verify.
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 37 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8a3c0f3d-e0d3-4df6-8392-bcb5ea6d4bfa
Commits

Reviewing files that changed from the base of the PR and between 3721eef and f29d4e6.

Files selected for processing: 1

  • pkgs/id/src/hosted_export.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T14:29:16.843913Z f29d4e6 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dezren39

Copy link
Copy Markdown
Member Author

Closing as superseded — collision record.

This PR duplicates work that had already landed. Lane WQ claimed #13289 first (2026-11-23T12:56:56Z, comment 7101845383) and merged the same fix via PR #13356 (c83e4410241); the issue is closed as completed. WQ's collision record (comment 7103625356) was posted before this PR existed and directed the junior claim to stand down; this PR was opened afterward in ignorance of it and is now withdrawn unmerged.

Cause of the duplicate, stated plainly: my pre-claim ownership read used gh api --paginate ... --jq with an object-shaped jq expression and stderr discarded, so the read errored (expected an object but got: array) and presented as an empty comment thread. The claim check therefore false-cleared. The implementation here was built and verified independently (64/64 hosted tests, mutation-checked), but it is the same change in substance and lands nothing.

Process lesson recorded for the lane briefs: paginated list reads need the .[] jq shape, and an ownership read must never suppress stderr — an errored read is not an empty thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant